-
-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add main interface for library #450
Conversation
@metcoder95 looks great and thanks for the PR 🎉 |
types/index.d.ts
Outdated
@@ -55,5 +55,12 @@ export interface DotenvConfigOutput { | |||
* | |||
*/ | |||
export function config(options?: DotenvConfigOptions): DotenvConfigOutput; | |||
|
|||
/** dotenv library interface */ | |||
export interface dotenv { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we export out this interface with the casing DotEnv
? It would then match the casing of the other interface here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually I think i am wrong about this let me download the code and get back to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok pulled down, a saw the behavior of this. I think we should Pascal case the interfaces. I would love for the typing to work with.
import dotenv from 'dotenv'
dotenv.foo() // throws on compile.
dotenv.config() // works
I wish I was better at typescript and could add some code of how to do this, but sadly I am not quite sure how to get this to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To do that, we can use namespace to make it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just update the interface to be Pascal case and I think this is good to go.
Done! 👍 |
As requested in the following Issue: #448
The PR exports a main interface for the dotenv library.